#define MyAppName "NodeBkService"
#define MyAppVersion "1.0.0"
#define MyAppPublisher "HuiYiXin"
#define MyAppExeName "元梦MR播控服务.exe"
#define OutputBaseFilenameSetup "元梦MR播控服务setup"
#define MyAppIcon "assets\logo.ico"  

[Setup]
AppId={{YOUR-GUID-HERE}}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppPublisher={#MyAppPublisher}
DefaultDirName={autopf}\{#MyAppName}
DefaultGroupName={#MyAppName}
OutputDir=setup
OutputBaseFilename={#OutputBaseFilenameSetup}
SetupIconFile={#MyAppIcon} 
PrivilegesRequired=admin


; 基本设置
Compression=none
DiskSpanning=no



[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked


[Dirs]
; 创建downloads目录并设置权限
Name: "{app}\downloads"; Permissions: users-full
Name: "{app}\logs"; Permissions: users-full

[Files]
Source: "dist\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "dist\wrapConfig.js"; DestDir: "{app}"; Flags: ignoreversion; Permissions: users-modify

; 复制图标文件
Source: "{#MyAppIcon}"; DestDir: "{app}"; Flags: ignoreversion
Source: "envConfig/.env.build"; DestDir: "{app}"; DestName: "envConfig/.env.build"; Flags: ignoreversion

[Icons]
; 开始菜单图标
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; IconFilename: "{app}\logo.ico"; 
;桌面图标
Name: "{autodesktop}\{#MyAppExeName}"; Filename: "{app}\{#MyAppExeName}"; IconFilename: "{app}\logo.ico"

[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent;  Parameters: "cross-env  NODE_ENV=build  node index.js"; WorkingDir: "{app}"